﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Finance.Common
{
    public static class ExtendMethods
    {
        public static bool IsNullOrEmpty<TItem>(this IEnumerable<TItem> source)
        {
            if (source == null) { return true; }
            else if (source is ICollection<TItem>)
            {
                return (source as ICollection<TItem>).Count == 0;
            }
            else
            {
                return false;
            }
        }
    }
}
